﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace YTSK.FrmKP
{
    public partial class FrmMain : Form
    {
        public FrmMain()
        {
            InitializeComponent();
            this.Icon = YTSK.Properties.Resources.Fly;
            this.Text = string.Format("税控开票接口---版本{0}-{1}-{2}",
                ServerConfig.Version.ToString("yyyyMMdd"), ServerConfig._company, ServerConfig.UserName);
        }

        private void bt_Set_Click(object sender, EventArgs e)
        {
            var f = new FrmSKSet();
            f.ShowDialog();
        }

        private void FrmSKTS_Load(object sender, EventArgs e)
        {
            if (ServerConfig.GetToken().ObjToString().Length == 0)
            {
                var f = new FrmKP.FrmLogin();
                f.ShowDialog();
            }
            if (ServerConfig.GetToken().ObjToString().Length == 0)
            { this.Close(); }
            else
            {
                this.Text = string.Format("税控开票接口---版本{0}-{1}-{2}",
                    ServerConfig.Version.ToString("yyyyMMdd"), ServerConfig._company, ServerConfig.UserName);

            }
        }

        private void bt_XP_Click(object sender, EventArgs e)
        {
            var f = new FrmKP.FrmLSD();
            f.Text = string.Format("ERP小票开票{0}-{1}-{2}",
                    ServerConfig.Version.ToString("yyyyMMdd"), ServerConfig._company, ServerConfig.UserName);
            this.Hide();
            f.ShowDialog();
            this.Show();
        }



        private void bt_JL_Click(object sender, EventArgs e)
        {
            var f = new FrmKP.FrmFXD();
            f.Text = string.Format("ERP分销开票{0}-{1}-{2}",
                ServerConfig.Version.ToString("yyyyMMdd"), ServerConfig._company, ServerConfig.UserName);
            this.Hide();
            f.ShowDialog();
            this.Show();
        }

        private void bt_List_Rd11_Click(object sender, EventArgs e)
        {
            var f = new FrmList.FrmRD11List();
            this.Hide();
            f.ShowDialog();
            this.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            cSK.cDll.SetCursorPos(0, 0);
            cSK.cDllExt.mouseDoubleClick(100, 100);

        }


        private void button2_Click(object sender, EventArgs e)
        {
            var f = new Frm.FrmVouchTotal();
            f.ShowDialog();
        }

        private void bt_List_FP_Click(object sender, EventArgs e)
        {
            var f = new FrmList.FrmSKList();
            f.ShowDialog();
        }


        private void bt_Total_Click(object sender, EventArgs e)
        {
            var f = new Frm.FrmSkTotal();
            f.Show();
        }

        private void bt_SkUpload_Click(object sender, EventArgs e)
        {
            var f = new Frm.FrmCompareFile();
            f.Show();
        }
    }
}
